<%@ page import="org.wso2.carbon.registry.lifecycle.accenture.sample.utils.Utils" %>
<%@ page import="org.wso2.carbon.registry.core.Registry" %>
<%@ page import="org.wso2.carbon.registry.core.session.CurrentSession" %>
<!--This class is used to create the subscription path-->
<%
    String subscriptionPath = request.getParameter("subscriptionPath");
    System.out.println("subscriptionPath:" + subscriptionPath);
    String signedInAs = null;
    Boolean authenticated = (Boolean) request.getSession().getAttribute("authenticated");
    if (authenticated != null && authenticated.booleanValue()) {
        signedInAs = (String) request.getSession().getAttribute("logged-user");
    }

    System.out.println("user:" + signedInAs);

    Registry registry = null;
    if (signedInAs != null) {
        registry = Utils.getRegistryService().getUserRegistry(signedInAs);

        if (registry != null) {
            Utils.createSubscriptionResource(registry, subscriptionPath);
        } else {
            System.err.println("Registry is null");
        }
    } else {
        System.err.println("Loggedin User is null");
    }




%>